//
//  huiyuanDetailsViewController.m
//  daogouApp
//
//  Created by panquanReabam.com on 15-6-2.
//  Copyright (c) 2015年 jiezsoft.com. All rights reserved.
//

#import "huiyuanDetailsViewController.h"
#import "HttpRequest.h"
#import "JSONKit.h"
#import "HAODEsingleton.h"
#import "ProductView.h"
#import "UIViewExt.h"
#import "RDVTabBarController.h"
#import "MJRefresh.h"
#import "orderListCell.h"
#import "MemberInformationViewController.h"
#import "OrderDetailViewController.H"
#import "ServiceDetailViewController.H"
#import "RefundDetailViewController.H"
#import "BusinessMemberfindIntegralListViewController.h"
#import "BusinessMemberAddressViewController.h"
#import "BusinessCouponDetailViewController.h"
#import "BusinessActDetailViewController.h"
@interface huiyuanDetailsViewController ()<MBProgressHUDDelegate,UIAlertViewDelegate,UIGestureRecognizerDelegate,UINavigationControllerDelegate,UITextFieldDelegate>

@property (strong, nonatomic) UIScrollView * scrollView;
@end

@implementation huiyuanDetailsViewController


{   UIView*beizhuView;
    UILabel *line;
    UIScrollView*myscrollView;
    HAODEsingleton* commdity;
    UIImageView* imageview;
    UILabel *lineLabel1;
    ProductView *clothView;
    NSMutableArray*Memo;
    NSMutableArray*Integral;
    NSMutableArray*Amount;
    NSMutableArray*CreateDate;
    float lastContentOffset;
    UILabel *lineLabel111;
    UIButton*agreementBtn;
    UIButton*agreementBtn1;
    BOOL saveAccount;
    BOOL saveAccount1;
    UIView*view11;
    UIView*view;
    NSDictionary*dic;
    UIButton* xiaButton;
    
    NSMutableArray*isUsed;
    NSMutableArray*endDate;
    NSMutableArray*couponId;
    NSMutableArray*beginDate;
    NSMutableArray*useLimitAmt;
    NSMutableArray*price;
    NSMutableArray*useTime;
    
    NSMutableArray*joinTime;
    NSMutableArray*ActendDate;
    NSMutableArray*actId;
    NSMutableArray*ActbeginDate;
    NSMutableArray*actName;
    NSMutableArray*isUsedName;
    NSMutableArray*actType;
   NSMutableArray*actuseTime;
    
     NSMutableArray*actStatus;
    UILabel*address1;
    
    NSMutableArray*DocNum;
    NSMutableArray*DocDate;
    NSMutableArray*DocTotal;
    NSMutableArray*ItemName;
    NSMutableArray*Number;
    NSMutableArray*orderType;
    NSMutableArray* GuideCode;
    NSMutableArray* GuideName;
    NSMutableArray* MemberCode;
    NSMutableArray* MemberName;
    NSMutableArray* orderId;
    NSMutableArray* itemTypes;
    NSMutableArray* earnestMoney;
    NSMutableArray*orderStatus;
    NSMutableArray*installStatus;
    NSMutableArray*deliveryStatus;
    NSMutableArray*payStatus;
    NSMutableArray*serviceType;
    NSMutableArray*serviceStatus;
    NSMutableArray*reasonType;
    NSMutableArray*refundType;
    NSMutableArray*refundStatus;
    
    UITableView *table_list;
    UITableView *table_list1;
    UITableView *table_list2;
    UITableView *table_detailList;
    
    UIButton* bu;
    UIButton* bu1;
    UIButton* bu2;
    
    
}
@synthesize alt = alt;
-(void)BackAction:(UIButton *)sender{
    
    
    [self.navigationController popViewControllerAnimated:YES];
    
}
- (void)viewDidDisappear:(BOOL)animated

{
    
    [super viewDidDisappear:animated];
    
    
    
    self.navigationController.delegate = nil;
    
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [[self rdv_tabBarController] setTabBarHidden:YES];
    self.navigationController.navigationBarHidden=NO;
        self.navigationController.navigationBar.barStyle = UIBaselineAdjustmentNone;
    UILabel *lineLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 43,ScreenWidth, 1)];
    [lineLabel setBackgroundColor:[UIColor colorWithRed:238.0/255.0 green:238.0/255.0 blue:238.0/255.0 alpha:1.0]];
    [self.navigationController.navigationBar addSubview:lineLabel];
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    [[UINavigationBar appearance] setBarTintColor:Color];
    
       UIImage* backImage = [UIImage imageNamed:@"fanhui"];
    CGRect backframe = CGRectMake(0,0,30,30);
    UIButton* backButton= [[UIButton alloc] initWithFrame:backframe];
    [backButton setBackgroundImage:backImage forState:UIControlStateNormal];
    backButton.titleLabel.font=[UIFont systemFontOfSize:13];
    [backButton addTarget:self action:@selector(BackAction:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem* leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    self.navigationItem.leftBarButtonItem = leftBarButtonItem;
    self.navigationController.delegate = self;
    
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
       self.title = @"会员详情";
    
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                     backColor,
                                                                     UITextAttributeTextColor,
                                                                     [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1],
                                                                     UITextAttributeTextShadowColor,
                                                                     [NSValue valueWithUIOffset:UIOffsetMake(0, 0)],
                                                                     UITextAttributeTextShadowOffset,
                                                                     [UIFont fontWithName:@"Helvetica Neue" size:tetlefot],
                                                                     UITextAttributeFont,nil]];
    
    
    
    
    
    
    
    UIButton*editor = [[UIButton alloc] initWithFrame:CGRectMake(30, 0.0, 20, 20)];
    [editor setImage:[UIImage imageNamed:@"_0000_xingxifankui.png"] forState:UIControlStateNormal];
    [editor addTarget:self action:@selector(editor:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem* myBtnBtn = [[UIBarButtonItem alloc] initWithCustomView:editor];
    self.navigationItem.rightBarButtonItem = myBtnBtn;
    
    
    
   self.s=@"";
    
    
    
    
    
    commdity = [HAODEsingleton shared];
    
    
    
    if ([commdity.gengxin isEqualToString:@""]) {
        
        [myscrollView removeFromSuperview];
        [self.customTabBar removeFromSuperview];
        [self.scrollView removeFromSuperview];
        [self gengxin];
        commdity.gengxin=@"123";
   
    }else{
        
        
        
    }

    
}

-(void)gengxin{
    
    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString* Token = [user objectForKey:@"tokenId"];
    if (Token ==nil) {
        Token=@"dd";
    }
    NSMutableDictionary *param = [NSMutableDictionary new];
    [param setValue:Token forKey:@"tokenId"];
    [param setValue:commdity.memberId forKey:@"memberId"];
    NSLog(@"====%@",param);[Global showIndeterminateHudSub:@"加载中，请稍后。。。" delay:30 view:self.view];

    [HttpRequest requestData:@"Business/Member/Detail" params:param success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
            
            NSLog(@"33333333====%@",severDataDict.dataDict);
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                
                NSMutableArray* arrr=[[NSMutableArray alloc]init];
                dic=severDataDict.dataDict ;
                arrr=[severDataDict.dataDict objectForKey:@"tags"];
                
                
                 NSMutableArray* Codearrr=[[NSMutableArray alloc]init];
                 NSMutableArray* Namearrr=[[NSMutableArray alloc]init];
                for (NSDictionary* dicc in arrr )
                {
                    [Codearrr addObject:[dicc valueForKey:@"code"]];
                    [Namearrr addObject:[dicc valueForKey:@"content"]];
                  
                    
                }
                
                commdity.selectTagNameArray=[Namearrr copy];
                commdity.selectTagCodeArray=[Codearrr copy];
                commdity.Memo=[severDataDict.dataDict objectForKey:@"memo"];
                commdity.memberId=[severDataDict.dataDict objectForKey:@"memberId"];
                commdity.DataLine=[severDataDict.dataDict objectForKey:@"tags"];
                commdity.WeChatId=[severDataDict.dataDict objectForKey:@"nickName"];
                commdity.ProvinceName=[severDataDict.dataDict objectForKey:@"provinceName"];
                commdity.CityName=[severDataDict.dataDict objectForKey:@"cityName"];
                
                commdity.RegionName=[severDataDict.dataDict objectForKey:@"regionName"];
                commdity.adresssss=[severDataDict.dataDict objectForKey:@"address"];
                
                commdity.Phone=[severDataDict.dataDict objectForKey:@"phone"];
                commdity.OpenID=[severDataDict.dataDict objectForKey:@"openId"];
                
                commdity.userName=[severDataDict.dataDict objectForKey:@"userName"];
                commdity.Sex=[severDataDict.dataDict objectForKey:@"sex"];
                commdity.consigneeAddr=[severDataDict.dataDict objectForKey:@"consigneeAddr"];
                commdity.consigneeName=[severDataDict.dataDict objectForKey:@"consigneeName"];
                commdity.consigneePhone=[severDataDict.dataDict objectForKey:@"consigneePhone"];
                
                
                myscrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,64, ScreenWidth, 250/2)];
                [myscrollView setBackgroundColor: [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0]];
                
                myscrollView.delegate = self;
                myscrollView.userInteractionEnabled = YES;
                myscrollView.scrollEnabled = YES;
                myscrollView.showsVerticalScrollIndicator = FALSE;
                myscrollView.showsHorizontalScrollIndicator = FALSE;
                

                
                
                NSString *s2 =[NSString stringWithFormat:@"%@ (%@)",  [dic objectForKey:@"userName"], [dic objectForKey:@"phone"]];
                UIFont *font2 = [UIFont systemFontOfSize:16];
                CGSize size2 = CGSizeMake(ScreenWidth-60, 2000);
                CGSize labelsize2 = [s2 sizeWithFont:font2 constrainedToSize:size2 lineBreakMode:NSLineBreakByCharWrapping];
                
                UILabel*name=[[UILabel alloc]initWithFrame:CGRectMake(15, 25, labelsize2.width, 16)];
                name.text= [NSString stringWithFormat:@"%@ (%@)",  [dic objectForKey:@"userName"], [dic objectForKey:@"phone"]];
                name.font= [UIFont systemFontOfSize:16];
                [name setTextColor:[UIColor blackColor]];
                [myscrollView addSubview:name];
                
                imageview=[[UIImageView alloc]initWithFrame:CGRectMake(name.right, 22.5, 20, 20)];
                [myscrollView addSubview:imageview];
                if (![[dic objectForKey:@"sex"] isEqual:[NSNull null]]) {
                    
                    if ([[dic objectForKey:@"sex"]isEqualToString:@"男"]) {
                        
                        
                        imageview.image=[UIImage imageNamed:@"nan"];
                        
                    }else{
                        
                        imageview.image=[UIImage imageNamed:@"nv"];
                        
                    }
                }else{
                    imageview.image=[UIImage imageNamed:@"nv"];
                    
                }
                
                
                
                UILabel*jifen=[[UILabel alloc]init];
                jifen.text=[NSString stringWithFormat:@"%@", @"积分"];
                jifen.font=[UIFont systemFontOfSize:contenfot];
                jifen.textColor=zhonghuiColor;
                jifen.frame=CGRectMake(imageview.right+10, 26, 30, contenfot);
                [myscrollView addSubview:jifen];
                //
                
                NSString *s12 = [NSString stringWithFormat:@"%@",[severDataDict.dataDict objectForKey:@"integral"]];
                UIFont *font12 = [UIFont systemFontOfSize:contenfot];
                CGSize size12 = CGSizeMake(320, 2000);
                CGSize labelsize12 = [s12 sizeWithFont:font12 constrainedToSize:size12 lineBreakMode:NSLineBreakByCharWrapping];
                
                UIButton*jifenduoshao=[[UIButton alloc]init];
                [jifenduoshao setTitle: [NSString stringWithFormat:@"%@",[severDataDict.dataDict objectForKey:@"integral"]] forState:UIControlStateNormal];
                
                jifenduoshao.titleLabel.font=[UIFont systemFontOfSize:contenfot];
                [jifenduoshao setTitleColor:hongsecolor forState:UIControlStateNormal];
                jifenduoshao.frame=CGRectMake(jifen.right-2,  23.5, labelsize12.width+10, 18);
                jifenduoshao.titleLabel.textAlignment=NSTextAlignmentCenter;

                [myscrollView addSubview:jifenduoshao];
                //
                
                
                UILabel*daogou=[[UILabel alloc]initWithFrame:CGRectMake(15,  57.5, 30, contenfot)];
                daogou.text=@"员工";
                daogou.font= [UIFont systemFontOfSize:contenfot];
                [daogou setTextColor:zhonghuiColor];
                [myscrollView addSubview:daogou];
                NSString *s121 =[dic objectForKey:@"createName"];
                UIFont *font121 = [UIFont systemFontOfSize:contenfot];
                CGSize size121 = CGSizeMake(ScreenWidth-60, 2000);
                CGSize labelsize121 = [s121 sizeWithFont:font121 constrainedToSize:size121 lineBreakMode:NSLineBreakByCharWrapping];
                UILabel*daogou1=[[UILabel alloc]initWithFrame:CGRectMake(daogou.right, 57.5,labelsize121.width, contenfot)];
                daogou1.text=[dic objectForKey:@"createName"];
                daogou1.font= [UIFont systemFontOfSize:contenfot];
                [daogou1 setTextColor:shenhuicolor];
                [myscrollView addSubview:daogou1];
                UILabel*mendian=[[UILabel alloc]initWithFrame:CGRectMake(daogou1.right+10, 57.5, 30, contenfot)];
                mendian.text=@"门店";
                mendian.font= [UIFont systemFontOfSize:contenfot];
                [mendian setTextColor:zhonghuiColor];
                [myscrollView addSubview:mendian];
                UILabel*mendian1=[[UILabel alloc]initWithFrame:CGRectMake(mendian.right, 57.5, 200, contenfot)];
                mendian1.text=[dic objectForKey:@"companyName"];
                mendian1.font= [UIFont systemFontOfSize:contenfot];
                [mendian1 setTextColor:shenhuicolor];
                [myscrollView addSubview:mendian1];
                
                
                
                NSString *s = [NSString stringWithFormat:@"收货地址  %@",commdity.consigneeAddr];
                commdity.adress=[NSString stringWithFormat:@"%@",commdity.consigneeAddr];
                
                UIFont *font = [UIFont systemFontOfSize:contenfot];
                CGSize size = CGSizeMake(ScreenWidth-100, 2000);
                CGSize labelsize = [s sizeWithFont:font constrainedToSize:size lineBreakMode:NSLineBreakByCharWrapping];
                address1 =[[UILabel alloc]initWithFrame:CGRectMake(15, 75, ScreenWidth-100, labelsize.height+5)];
                address1.text=s ;
                address1.numberOfLines=2;
                address1.font= [UIFont systemFontOfSize:contenfot];
                [address1 setTextColor:shenhuicolor];
                
                [myscrollView addSubview:address1];
 
                UIButton*duodiz=[[UIButton alloc]init];
                [duodiz setTitle: [NSString stringWithFormat:@"%@",@"地址管理"] forState:UIControlStateNormal];
                
                duodiz.titleLabel.font=[UIFont systemFontOfSize:contenfot];
                [duodiz setTitleColor:shenhuicolor forState:UIControlStateNormal];
                duodiz.frame=CGRectMake(address1.right+3,  75, 70, 20);
                duodiz.titleLabel.textAlignment=NSTextAlignmentCenter;
                [duodiz.layer setCornerRadius:2.0];
                [duodiz.layer setBorderWidth:0.35];
                [duodiz.layer setMasksToBounds:YES];
                CGColorSpaceRef colorSpace1 = CGColorSpaceCreateDeviceRGB();
                CGColorRef colorref1 = CGColorCreate(colorSpace1,(CGFloat[]){224/255.0,224/255.0, 224/255.0, 1.0   });
                [duodiz.layer setBorderColor:colorref1];//边框颜色
                [duodiz addTarget:self action:@selector(duodiz:) forControlEvents:UIControlEventTouchUpInside];
                [myscrollView addSubview:duodiz];
                
                
                [Global hideProgressHUDInternal:self.view];
     
                xiaButton= [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth/2-15,address1.bottom,30,30)];
                [xiaButton setBackgroundImage:[UIImage imageNamed:@"zhankai"] forState:UIControlStateNormal];
                xiaButton.titleLabel.font=[UIFont systemFontOfSize:13];
                [xiaButton addTarget:self action:@selector(zankai:) forControlEvents:UIControlEventTouchUpInside];
                [myscrollView addSubview:xiaButton];
                
                
                view=[[UIView alloc]initWithFrame:CGRectMake(0, xiaButton.bottom, ScreenWidth, 250/2)];
                view.backgroundColor=[UIColor whiteColor];
                [myscrollView addSubview:view];
                
               
                
                
                
                if (arrr.count>0) {
                    
                    for (int i = 0,j = 0; i < arrr.count; i++) {
                        if (i % 4 == 0) {
                            j++;
                        }
                        
                        clothView = [[ProductView alloc]initWithFrame:CGRectMake(12.5+(ScreenWidth/4-5)*(i%4), 10+(40*(j-1)), ScreenWidth/4-15, 26)];
                        clothView.buttonView.titleLabel.textAlignment=NSTextAlignmentCenter;
                        clothView.buttonView.titleLabel.font=[UIFont systemFontOfSize:contenfot];
                        [clothView.buttonView setTitle: [[arrr objectAtIndex:i] objectForKey:@"content"] forState:UIControlStateNormal];
                        clothView.buttonView.backgroundColor=[UIColor colorWithRed:255/255.0 green:255/255.0 blue:234/255.0 alpha:1];
                        clothView.buttonView.tag=[[[arrr objectAtIndex:i] objectForKey:@"code"] intValue];
                        [clothView.buttonView setTitleColor:huangtitleColor forState:0];
                        [clothView.buttonView.layer setCornerRadius:13.0];
                        [clothView.buttonView.layer setBorderWidth:0.43];
                        [clothView.buttonView.layer setMasksToBounds:YES];
                        CGColorSpaceRef colorSpace2 = CGColorSpaceCreateDeviceRGB();
                        CGColorRef colorref2 = CGColorCreate(colorSpace2,(CGFloat[]){209/255.0,170/255.0, 56/255.0, 1.0   });
                        [clothView.buttonView.layer setBorderColor:colorref2];//边框颜色
                        
                        [view addSubview:clothView];
                        
                        
                    }
                    
                    
                }else {
                    
                    
                    
                }
                
                
                commdity.Memo=[NSString stringWithFormat:@"%@",[dic objectForKey:@"memo"]];
               
                
                
                beizhuView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 90)];
                
                

                
                UIImageView *_xianview1 = [[UIImageView alloc]initWithFrame:CGRectMake(15,0, ScreenWidth-30, 0.5)];
                _xianview1.image=[UIImage imageNamed:@"hengxian"];
                [beizhuView addSubview:_xianview1];
                UILabel*beizhu=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, 30, 40)];
                beizhu.text=@"备注";
                beizhu.font= [UIFont systemFontOfSize:contenfot];
                [beizhu setTextColor:[UIColor blackColor]];
                [beizhuView addSubview:beizhu];
                
                if ([commdity.Memo length]>1) {
                    
                    
                    NSString *s1 =[NSString stringWithFormat:@"%@", commdity.Memo];
                    UIFont *font1 = [UIFont systemFontOfSize:contenfot];
                    CGSize size1 = CGSizeMake(ScreenWidth-60, 2000);
                    CGSize labelsize1 = [s1 sizeWithFont:font1 constrainedToSize:size1 lineBreakMode:NSLineBreakByCharWrapping];
                    
                    UILabel*beizhu1=[[UILabel alloc]initWithFrame:CGRectMake(15, beizhu.bottom, ScreenWidth-40, labelsize1.height+20)];
                    beizhu1.text=s1;
                    beizhu1.numberOfLines=0;
                    beizhu1.font= [UIFont systemFontOfSize:contenfot];
                    [beizhu1 setTextColor:shenhuicolor];
                    [beizhuView addSubview:beizhu1];
                    
                    if (arrr.count>0) {
                     beizhuView.frame=CGRectMake(0, clothView.bottom+10, ScreenWidth, beizhu1.bottom);
                    }else{
                    
                     beizhuView.frame=CGRectMake(0, 30, ScreenWidth,  beizhu1.bottom);
                    
                    }
                   
                    
                    
                }else{
                    NSString *s1 =[NSString stringWithFormat:@"%@", @"无"];
                    UIFont *font1 = [UIFont systemFontOfSize:contenfot];
                    CGSize size1 = CGSizeMake(ScreenWidth-60, 2000);
                    CGSize labelsize1 = [s1 sizeWithFont:font1 constrainedToSize:size1 lineBreakMode:NSLineBreakByCharWrapping];
                    
                    UILabel*beizhu1=[[UILabel alloc]initWithFrame:CGRectMake(15, beizhu.bottom-5, ScreenWidth-40, labelsize1.height+30)];
                    beizhu1.text=s1;
                    beizhu1.numberOfLines=0;
                    beizhu1.font= [UIFont systemFontOfSize:contenfot];
                    [beizhu1 setTextColor:shenhuicolor];
                    [beizhuView addSubview:beizhu1];
                   
                    if (arrr.count>0) {
                        beizhuView.frame=CGRectMake(0, clothView.bottom+10, ScreenWidth, beizhu1.bottom);
                    }else{
                        
                        beizhuView.frame=CGRectMake(0, 30, ScreenWidth, beizhu1.bottom);
                        
                    }
                  
                    
                    
                }
                
                [view addSubview:beizhuView];
                
                
                
                
                view.frame=CGRectMake(0, xiaButton.bottom, ScreenWidth,beizhuView.bottom);
                
               
               
                myscrollView.frame=CGRectMake(0, 64, ScreenWidth, xiaButton.bottom);
                [myscrollView setContentSize:CGSizeMake(ScreenWidth, xiaButton.bottom)];
                
                [self addd];
                [self liebiaoshuju];
                
                [self.view addSubview:myscrollView];
  
                
            }else{
                [Global hideProgressHUDInternal:self.view];
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:requestResultStr delegate:self cancelButtonTitle:@"确定返回" otherButtonTitles: nil];
                [alert show];
                
            }
            
        }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            
            [Global showTextHudSub:@"连接失败" view:self.view];
        }
        
    }];
}
-(void)zankai:(UIButton*)sender{
    
    self.s=@"you";
    
    [xiaButton removeFromSuperview];
    view.frame=CGRectMake(0, address1.bottom+10, ScreenWidth,beizhuView.bottom);
    myscrollView.frame=CGRectMake(0, 64, ScreenWidth, view.bottom);
    [myscrollView setContentSize:CGSizeMake(ScreenWidth, view.bottom)];
    [self.customTabBar removeFromSuperview];
    [self.scrollView removeFromSuperview];
    [self addd];
    [self liebiaoshuju];
}



-(void)liebiaoshuju{
    
    
    
    joinTime= [[NSMutableArray alloc] init];
    ActendDate= [[NSMutableArray alloc] init];
    actId= [[NSMutableArray alloc] init];
    ActbeginDate= [[NSMutableArray alloc] init];
    actName= [[NSMutableArray alloc] init];
    isUsedName= [[NSMutableArray alloc] init];
    actName= [[NSMutableArray alloc] init];
    isUsedName= [[NSMutableArray alloc] init];
    actType= [[NSMutableArray alloc] init];
    
    
    isUsed= [[NSMutableArray alloc] init];
    endDate= [[NSMutableArray alloc] init];
    couponId= [[NSMutableArray alloc] init];
    beginDate= [[NSMutableArray alloc] init];
    useLimitAmt= [[NSMutableArray alloc] init];
    price= [[NSMutableArray alloc] init];
    useTime= [[NSMutableArray alloc] init];
    actuseTime= [[NSMutableArray alloc] init];
    actStatus= [[NSMutableArray alloc] init];
    MemberName= [[NSMutableArray alloc] init];
    MemberCode= [[NSMutableArray alloc] init];
    GuideName= [[NSMutableArray alloc] init];
    GuideCode= [[NSMutableArray alloc] init];
    orderType= [[NSMutableArray alloc] init];
    Number= [[NSMutableArray alloc] init];
    ItemName= [[NSMutableArray alloc] init];
    DocTotal = [[NSMutableArray alloc] init];
    DocDate = [[NSMutableArray alloc] init];
    DocNum = [[NSMutableArray alloc] init];
    orderStatus = [[NSMutableArray alloc] init];
    installStatus = [[NSMutableArray alloc] init];
    deliveryStatus = [[NSMutableArray alloc] init];
    payStatus = [[NSMutableArray alloc] init];
    serviceType = [[NSMutableArray alloc] init];
    serviceStatus = [[NSMutableArray alloc] init];
    reasonType = [[NSMutableArray alloc] init];
    refundType = [[NSMutableArray alloc] init];
    refundStatus = [[NSMutableArray alloc] init];
    orderId = [[NSMutableArray alloc] init];
    itemTypes= [[NSMutableArray alloc] init];
    earnestMoney= [[NSMutableArray alloc] init];

    
    
    NSUserDefaults *user12 = [NSUserDefaults standardUserDefaults];
    NSString* Token12 = [user12 objectForKey:@"tokenId"];
    
    NSMutableDictionary *param12 = [NSMutableDictionary new];
    [param12 setValue:Token12 forKey:@"tokenId"];
    [param12 setValue:commdity.memberId forKey:@"memberId"];
    
    
    NSLog(@"====%@",param12);
    
    [HttpRequest requestData:@"Business/MAct/List" params:param12 success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
            
            NSLog(@"啊啊啊啊啊====%@",severDataDict.dataDict);
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                
                NSMutableArray* arrr=[[NSMutableArray alloc]init];
                
                arrr=[severDataDict.dataDict objectForKey:@"DataLine"];
                
                
                if (arrr.count>0) {
                    
            
                    for (NSDictionary* dicc in arrr )
                    {
                        [joinTime addObject:[dicc valueForKey:@"joinTime"]];
                        [ActendDate addObject:[dicc valueForKey:@"endDate"]];
                        [actId addObject:[dicc valueForKey:@"actId"]];
                        [ActbeginDate addObject:[dicc valueForKey:@"beginDate"]];
                        [actName addObject:[dicc valueForKey:@"actName"]];
                        [isUsedName addObject:[dicc valueForKey:@"isUsedName"]];
                        [actType addObject:[dicc valueForKey:@"actType"]];
                        [actStatus addObject:[dicc valueForKey:@"actStatus"]];
                        [actuseTime addObject:[dicc valueForKey:@"joinTime"]];
                    }
                    
                    
                }
                [table_list2 reloadData];
                
            }else{
                [Global hideProgressHUDInternal:self.view];
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                // [Global showTextHud:requestResultStr view:self.view];
                [Global showTextHudSub:requestResultStr view:self.view];
            }
            
        }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            
            [Global showTextHudSub:@"连接失败" view:self.view];
        }
        
    }];

    NSUserDefaults *user1 = [NSUserDefaults standardUserDefaults];
    NSString* Token1 = [user1 objectForKey:@"tokenId"];
    
    NSMutableDictionary *param1 = [NSMutableDictionary new];
    [param1 setValue:Token1 forKey:@"tokenId"];
    [param1 setValue:commdity.memberId forKey:@"memberId"];
    
    
    NSLog(@"====%@",param1);
    
    [HttpRequest requestData:@"Business/MCoupon/List" params:param1 success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
            
            NSLog(@"====%@",severDataDict.dataDict);
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                
                NSMutableArray* arrr=[[NSMutableArray alloc]init];
                
                arrr=[severDataDict.dataDict objectForKey:@"DataLine"];
                
                
                if (arrr.count>0) {
                    
                    
                    
                    
                    for (NSDictionary* dicc in arrr )
                    {
                        [isUsed addObject:[dicc valueForKey:@"isUsed"]];
                        [endDate addObject:[dicc valueForKey:@"endDate"]];
                        [couponId addObject:[dicc valueForKey:@"couponId"]];
                        [beginDate addObject:[dicc valueForKey:@"beginDate"]];
                        [useLimitAmt addObject:[dicc valueForKey:@"useLimitAmt"]];
                        [price addObject:[dicc valueForKey:@"price"]];
                        
                        [useTime addObject:[dicc valueForKey:@"useTime"]];
                        
                    }
                    
                    
                }
                 [table_list1 reloadData];
                
            }else{
                [Global hideProgressHUDInternal:self.view];
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                // [Global showTextHud:requestResultStr view:self.view];
                [Global showTextHudSub:requestResultStr view:self.view];
            }
            
        }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            
            [Global showTextHudSub:@"连接失败" view:self.view];
        }
        
    }];

    
    NSUserDefaults *user11 = [NSUserDefaults standardUserDefaults];
    NSString* Token11 = [user11 objectForKey:@"tokenId"];
    NSMutableDictionary *param11 = [NSMutableDictionary new];
    [param11 setValue:Token11 forKey:@"tokenId"];
    [param11 setValue:commdity.memberId forKey:@"memberId"];
    [param11 setValue:@"1" forKey:@"PageIndex"];
    [param11 setValue:@"50" forKey:@"PageSize"];
    
    NSLog(@"====%@",param11);
    
    [HttpRequest requestData:@"Business/Member/Trades" params:param11 success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
            
            NSLog(@"====%@",severDataDict.dataDict);
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                
                NSMutableArray* arrr=[[NSMutableArray alloc]init];
                
                arrr=[severDataDict.dataDict objectForKey:@"DataLine"];
                
                if (arrr.count>0) {
                    
                    
                    
                    
                    for (NSDictionary* dicc in arrr )
                    {
                        [DocNum addObject:[dicc valueForKey:@"orderNo"]];
                        [orderId addObject:[dicc valueForKey:@"orderId"]];
                        [DocDate addObject:[dicc valueForKey:@"orderDate"]];
                        [DocTotal addObject:[dicc valueForKey:@"realMoney"]];
                        [ItemName addObject:[dicc valueForKey:@"itemTypes"]];
                        [Number addObject:[dicc valueForKey:@"totalQuantity"]];
                        [orderType addObject:[dicc valueForKey:@"orderType"]];
                        [GuideName addObject:[dicc valueForKey:@"memberName"]];
                        [itemTypes addObject:[dicc valueForKey:@"itemTypes"]];
                        
                        [earnestMoney addObject:[dicc valueForKey:@"earnestMoney"]];
                        [orderStatus addObject:[dicc valueForKey:@"orderStatus"]];
                        [installStatus addObject:[dicc valueForKey:@"installStatus"]];
                        [deliveryStatus addObject:[dicc valueForKey:@"deliveryStatus"]];
                        [payStatus addObject:[dicc valueForKey:@"payStatus"]];
                        [serviceType addObject:[dicc valueForKey:@"serviceType"]];
                        [serviceStatus addObject:[dicc valueForKey:@"serviceStatus"]];
                        [reasonType addObject:[dicc valueForKey:@"reasonType"]];
                        [refundType addObject:[dicc valueForKey:@"refundType"]];
                        [refundStatus addObject:[dicc valueForKey:@"refundStatus"]];
                        
                        
                        
                    }
                    [table_list reloadData];
                    
                }
                
                
                
            }else{
                [Global hideProgressHUDInternal:self.view];
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                // [Global showTextHud:requestResultStr view:self.view];
                [Global showTextHudSub:requestResultStr view:self.view];
            }
            
        }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            
            [Global showTextHudSub:@"连接失败" view:self.view];
        }
        
    }];

 
    table_list = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-myscrollView.bottom-44) style:UITableViewStylePlain];
    table_list.delegate = self;
    table_list.dataSource = self;
    table_list.rowHeight = 60;
    table_list.separatorStyle=UITableViewCellSeparatorStyleNone;
    
    table_list1 = [[UITableView alloc]initWithFrame:CGRectMake(ScreenWidth, 0, ScreenWidth, ScreenHeight-myscrollView.bottom-44) style:UITableViewStylePlain];
    table_list1.delegate = self;
    table_list1.dataSource = self;
    table_list1.separatorStyle=UITableViewCellSeparatorStyleNone;
  
    table_list2 = [[UITableView alloc]initWithFrame:CGRectMake(2*ScreenWidth, 0, ScreenWidth, ScreenHeight-myscrollView.bottom-44) style:UITableViewStylePlain];
    table_list2.delegate = self;
    table_list2.dataSource = self;
    table_list2.rowHeight = 60;
    table_list2.separatorStyle=UITableViewCellSeparatorStyleNone;
    
    
    
    
    
    self.scrollView = [[UIScrollView alloc] init];
    self.scrollView.frame = CGRectMake(0, myscrollView.bottom+44+10, ScreenWidth, ScreenHeight-myscrollView.bottom-44);
    self.scrollView.pagingEnabled = YES;
    self.scrollView.showsHorizontalScrollIndicator = NO;
    self.scrollView.showsVerticalScrollIndicator = NO;
    [self.view addSubview:self.scrollView];
   
    
    NSArray * ads = @[@"",@"",@""];
    
    for (int h = 0 ; h < ads.count; h++) {
        UIImage * image = [UIImage imageNamed:ads[h]];
        UIImageView * imageView = [[UIImageView alloc] initWithImage:image];
        CGRect frame = self.scrollView.frame;
        frame.origin.x = h * frame.size.width;
        frame.origin.y = 0;
        imageView.frame = frame;
        
        [self.scrollView addSubview:imageView];
        
    }
    
    CGSize size = self.scrollView.frame.size;
    size.width *= 3;
    self.scrollView.contentSize = size;
    self.scrollView.delegate = self;
    
    
    [self.scrollView addSubview:table_list];
    [self.scrollView addSubview:table_list1];
    [self.scrollView addSubview:table_list2];
   

}


- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if ([self.s isEqualToString:@"you"]) {
        CGFloat offset=scrollView.contentOffset.y;
        if (offset>100) {
            
            xiaButton= [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth/2-15,address1.bottom,30,30)];
            [xiaButton setBackgroundImage:[UIImage imageNamed:@"zhankai"] forState:UIControlStateNormal];
            xiaButton.titleLabel.font=[UIFont systemFontOfSize:13];
            [xiaButton addTarget:self action:@selector(zankai:) forControlEvents:UIControlEventTouchUpInside];
            [myscrollView addSubview:xiaButton];
            
            view.frame=CGRectMake(0, xiaButton.bottom, ScreenWidth,beizhuView.bottom);
            myscrollView.frame=CGRectMake(0, 64, ScreenWidth, xiaButton.bottom);
            [myscrollView setContentSize:CGSizeMake(ScreenWidth, xiaButton.bottom)];
            [self.customTabBar removeFromSuperview];
            [self.scrollView removeFromSuperview];
            [self addd];
            [self liebiaoshuju];
            NSLog(@"shang");
           self.s=@"";
        }else {
            
           
            
            
        }

    }else{
    
    
    
    }
    
    if (self.scrollView.bounds.origin.x==0) {
        self.moveImage.frame = CGRectMake(0, 43+10, ScreenWidth/3, 1.5);
        
        [bu setTitleColor:titleColor forState:UIControlStateNormal];
        [bu1 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [bu2 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
  
        if (table_list.bounds.origin.y==0) {
            
        }
    }
    
    if (self.scrollView.bounds.origin.x==ScreenWidth) {
        self.moveImage.frame = CGRectMake(ScreenWidth/3, 43+10, ScreenWidth/3, 1.5);
        
        [bu1 setTitleColor:titleColor forState:UIControlStateNormal];
        [bu setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        
        [bu2 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        if (table_list1.bounds.origin.y==0) {
            
        }}
    
    if (self.scrollView.bounds.origin.x==ScreenWidth*2) {
        self.moveImage.frame = CGRectMake(ScreenWidth/3*2, 43+10, ScreenWidth/3, 1.5);
        
        [bu1 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [bu setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        
        [bu2 setTitleColor:titleColor forState:UIControlStateNormal];
        if (table_list2.bounds.origin.y==0) {
            
        }
    }
    
    
    
}

-(void)addd{
  
    
    
    self.customTabBar = [[UIView alloc]initWithFrame:CGRectMake(0,myscrollView.bottom, ScreenWidth, 44+10)];
    UIView* disetu=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 10)];
    disetu.backgroundColor=zuiqianhuicolor;
    disetu.layer.borderWidth = 0.35;
    disetu.layer.borderColor = qianhuicolor.CGColor;
    
    [ self.customTabBar addSubview:disetu];
    UILabel* label=[[UILabel alloc]initWithFrame:CGRectMake(0,43.65+10, ScreenWidth, 0.35)];
    label.backgroundColor=qianhuicolor;
    [self.customTabBar addSubview:label];
    //添加移动的图片
    self.moveImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"tabbar_slider.png"]];
    self.moveImage.backgroundColor=titleColor;
    self.moveImage.frame = CGRectMake(0, 0, ScreenWidth/2, 1.5);
    CGFloat sliderImageViewCenterX = ScreenWidth/3/2;
    [self.moveImage setCenter:CGPointMake(sliderImageViewCenterX, 43+10)];
    [self.customTabBar addSubview:_moveImage];
    [self.view addSubview:self.customTabBar];
  
    
    bu=[[UIButton alloc]initWithFrame:CGRectMake(0, 10, ScreenWidth/3, 44)];
    [bu setTitle:@"交易" forState:UIControlStateNormal];
    [bu setTitleColor:titleColor forState:UIControlStateNormal];
    bu .titleLabel.font=[UIFont systemFontOfSize:16];
    [bu addTarget:self action:@selector(tabBarItemClicked) forControlEvents:UIControlEventTouchUpInside];
    [self.customTabBar addSubview:bu];
    
    bu1=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth/3, 10, ScreenWidth/3, 44)];
    [bu1 setTitle:@"优惠券" forState:UIControlStateNormal];
    [bu1 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    bu1 .titleLabel.font=[UIFont systemFontOfSize:16];
    [bu1 addTarget:self action:@selector(tabBarItemClicked1) forControlEvents:UIControlEventTouchUpInside];
    [self.customTabBar addSubview:bu1];
    
    bu2=[[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth/3*2, 10, ScreenWidth/3, 44)];
    [bu2 setTitle:@"促销活动" forState:UIControlStateNormal];
    [bu2 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    bu2 .titleLabel.font=[UIFont systemFontOfSize:16];
    [bu2 addTarget:self action:@selector(tabBarItemClicked2) forControlEvents:UIControlEventTouchUpInside];
    [self.customTabBar addSubview:bu2];
    
}

-(void)tabBarItemClicked{
    //更换moveImage的位置
    
    [bu1 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [bu setTitleColor:titleColor forState:UIControlStateNormal];
    [bu2 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    CGFloat sliderImageViewCenterX = ScreenWidth/3/2 + (0 * ScreenWidth/3);
    [UIView animateWithDuration:0.2f animations:^{
        self.moveImage.center = CGPointMake(sliderImageViewCenterX, self.moveImage.center.y);
        
        
        
    }];
    
    [self.scrollView setContentOffset:CGPointMake(0, 0) ];
    self.scrollView.bouncesZoom=NO;
}





-(void)tabBarItemClicked1{
    //更换moveImage的位置
    [bu1 setTitleColor:titleColor forState:UIControlStateNormal];
    [bu setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [bu2 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    
    CGFloat sliderImageViewCenterX = ScreenWidth/3/2 + (1 * ScreenWidth/3);
    [UIView animateWithDuration:0.2f animations:^{
        self.moveImage.center = CGPointMake(sliderImageViewCenterX, self.moveImage.center.y);
        
        
        
    }];
    
    [self.scrollView setContentOffset:CGPointMake(ScreenWidth, 0) ];
    self.scrollView.bouncesZoom=NO;
}


-(void)tabBarItemClicked2{
    //更换moveImage的位置
    [bu1 setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [bu setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [bu2 setTitleColor:titleColor forState:UIControlStateNormal];
    
    CGFloat sliderImageViewCenterX = ScreenWidth/3/2 + (1 * ScreenWidth/3);
    [UIView animateWithDuration:0.2f animations:^{
        self.moveImage.center = CGPointMake(sliderImageViewCenterX, self.moveImage.center.y);
        
        
        
    }];
    
    [self.scrollView setContentOffset:CGPointMake(ScreenWidth*2, 0) ];
    self.scrollView.bouncesZoom=NO;
}





- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    
    if (buttonIndex == 0) {
        
        [self.navigationController popViewControllerAnimated:YES];
        
    }
    
}



//上拉刷新
- (void)addFooter
{
    
    
    
}
- (void)doneWithView:(MJRefreshBaseView *)refreshView
{
    [_table reloadData];
    [refreshView endRefreshing];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (tableView == table_list) {
            return [DocNum count];
        }
    
    if (tableView == table_list1) {
         return [couponId count];
    
    }
    
    if (tableView == table_list2) {
        return [actId count];
    }
    
    return [DocNum count];
  
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    
    orderListCell* cell = (orderListCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    {
        NSArray* nib = [[NSBundle mainBundle] loadNibNamed:@"orderListCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }
    UIButton*jiantou = [[UIButton alloc]init];
    jiantou.frame = CGRectMake(0,0, 8, 13);
    [jiantou setImage:[UIImage imageNamed:@"xiangzuo-.png"] forState:UIControlStateNormal];
    cell.selectionStyle =UITableViewCellSelectionStyleNone;
    //    cell.accessoryView = jiantou;
    if (tableView == table_list) {
       
        NSString *s21 = [NSString stringWithFormat:@"%@",  [DocNum objectAtIndex:indexPath.row]];
        UIFont *font21 = [UIFont systemFontOfSize:contenfot];
        CGSize size21 = CGSizeMake(ScreenWidth-30, 2000);
        CGSize labelsize21 = [s21 sizeWithFont:font21 constrainedToSize:size21 lineBreakMode:NSLineBreakByCharWrapping];
        cell.DocNum.text =[NSString stringWithFormat:@"%@ ",  s21];
        
        cell.DocNum.textColor=[UIColor blackColor];
        cell.DocNum.frame=CGRectMake(15, 20, labelsize21.width+5,contenfot);
        cell.DocNum.font= [UIFont fontWithName:@"Arial" size:contenfot];
        
        NSString *s12 = [NSString stringWithFormat:@"%@", @"会员"];
        UIFont *font12 = [UIFont systemFontOfSize:contenfot];
        CGSize size12 = CGSizeMake(320, 2000);
        CGSize labelsize12 = [s12 sizeWithFont:font12 constrainedToSize:size12 lineBreakMode:NSLineBreakByCharWrapping];
        
        //直接收款
        
        if ([[orderType objectAtIndex:indexPath.row] isEqualToString:@"other"]) {
            cell.DocStatus.frame=CGRectMake(cell.DocNum.right-6, 20, 80, contenfot);
            cell.DocStatus.font=[UIFont systemFontOfSize:contenfot];
            cell.DocStatus.textAlignment=NSTextAlignmentCenter;
            
            
            if ([[orderStatus objectAtIndex:indexPath.row] isEqualToString:@"Y"]) {
                cell.DocStatus.textColor=luseColor;
                
                cell.DocStatus.text=@"自定义收全款";
            }
            
            
            cell.ItemName.text=[NSString stringWithFormat:@"%@", @"直接收款"];
            cell.ItemName.font=[UIFont systemFontOfSize:contenfot];
            cell.ItemName.textColor=zhonghuiColor;
            cell.ItemName.frame=CGRectMake(15,   70,  130, contenfot);
            
        }
        
        
        
        if ([[orderType objectAtIndex:indexPath.row] isEqualToString:@"order"]) {
            cell.DocStatus.frame=CGRectMake(cell.DocNum.right-6,  20, 60, contenfot);
            cell.DocStatus.font=[UIFont systemFontOfSize:contenfot];
            cell.DocStatus.textAlignment=NSTextAlignmentCenter;
            
            if ([[orderStatus objectAtIndex:indexPath.row] isEqualToString:@"C"]) {
                cell.DocStatus.textColor=titleColor;
                cell.DocStatus.text=@"已取消";
            }if ([[orderStatus objectAtIndex:indexPath.row] isEqualToString:@"P"]) {
                cell.DocStatus.textColor=luseColor;
                cell.DocStatus.text=@"收定金";
            }
            if ([[orderStatus objectAtIndex:indexPath.row] isEqualToString:@"N"]) {
                cell.DocStatus.textColor=[UIColor colorWithRed:4/255.00 green:184/255.00 blue:149/255.00 alpha:1.0];
                cell.DocStatus.text=@"未收款";
            }
            if ([[orderStatus objectAtIndex:indexPath.row] isEqualToString:@"Y"]) {
                cell.DocStatus.textColor=luseColor;
                
                cell.DocStatus.text=@"收全款";
            }
            
            
            
            cell.Reasons.frame=CGRectMake(cell.DocStatus.right-1,  20, 55, contenfot);
            
            cell.Reasons.font=[UIFont systemFontOfSize:contenfot];
            cell.Reasons.textAlignment=NSTextAlignmentCenter;
            if ([[deliveryStatus objectAtIndex:indexPath.row] isEqualToString:@"N"]) {
                cell.Reasons.textColor=hongsecolor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"未配送"];
            }if ([[deliveryStatus objectAtIndex:indexPath.row] isEqualToString:@"Y"]) {
                cell.Reasons.textColor=luseColor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"已配送"];
            }
            if ([[deliveryStatus objectAtIndex:indexPath.row] isEqualToString:@"B"]) {
                cell.Reasons.textColor=luseColor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"部分配送"];
            }
            if ([[deliveryStatus objectAtIndex:indexPath.row] isEqualToString:@"X"]) {
                cell.Reasons.textColor=luseColor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"无需配送"];
                
            }
            
            cell.anzhuang.frame=CGRectMake(cell.Reasons.right-1, 20, 55, contenfot);
            
            cell.anzhuang.font=[UIFont systemFontOfSize:contenfot];
            cell.anzhuang.textAlignment=NSTextAlignmentCenter;
            if ([[installStatus objectAtIndex:indexPath.row] isEqualToString:@"N"]) {
                cell.anzhuang.textColor=hongsecolor;
                cell.anzhuang.text=[NSString stringWithFormat:@"%@",  @"未安装"];
            }if ([[installStatus objectAtIndex:indexPath.row] isEqualToString:@"Y"]) {
                cell.anzhuang.textColor=luseColor;
                cell.anzhuang.text=[NSString stringWithFormat:@"%@",  @"已安装"];
            }
            if ([[installStatus objectAtIndex:indexPath.row] isEqualToString:@"B"]) {
                cell.anzhuang.textColor=luseColor;
                cell.anzhuang.text=[NSString stringWithFormat:@"%@",  @"部分安装"];
            }
            if ([[installStatus objectAtIndex:indexPath.row] isEqualToString:@"X"]) {
                cell.anzhuang.textColor=luseColor;
                cell.anzhuang.text=[NSString stringWithFormat:@"%@",  @"无需安装"];
                
            }
            
            
            cell.ItemName.text=[NSString stringWithFormat:@"%@", @"购买"];
            cell.ItemName.font=[UIFont systemFontOfSize:contenfot];
            cell.ItemName.textColor=zhonghuiColor;
            cell.ItemName.frame=CGRectMake(15,  70,  labelsize12.width+3, contenfot);
            
            NSString *s12 = [NSString stringWithFormat:@"%@ %@件", [ItemName objectAtIndex:indexPath.row], [Number objectAtIndex:indexPath.row]];
            UIFont *font12 = [UIFont systemFontOfSize:contenfot];
            CGSize size12 = CGSizeMake(320, 2000);
            CGSize labelsize12 = [s12 sizeWithFont:font12 constrainedToSize:size12 lineBreakMode:NSLineBreakByCharWrapping];
            cell.ItemName1.text=[NSString stringWithFormat:@"%@ %@件", [ItemName objectAtIndex:indexPath.row], [Number objectAtIndex:indexPath.row]];
            cell.ItemName1.font=[UIFont systemFontOfSize:contenfot];
            cell.ItemName1.textColor=shenhuicolor;
            cell.ItemName1.frame=CGRectMake(cell.ItemName.right,  70, labelsize12.width+5, contenfot);
            
        }
        
    //service
        
        
        if ([[orderType objectAtIndex:indexPath.row] isEqualToString:@"service"]) {
            cell.DocStatus.frame=CGRectMake(cell.DocNum.right-6,  20, 60, contenfot);
            cell.DocStatus.font=[UIFont systemFontOfSize:contenfot];
            cell.DocStatus.textAlignment=NSTextAlignmentCenter;
            
            cell.DocStatus.textColor=hongsecolor;
            cell.DocStatus.text=[NSString stringWithFormat:@"%@", [serviceType objectAtIndex:indexPath.row]];
            
            cell.Reasons.frame=CGRectMake(cell.DocStatus.right-1,  20, 55, contenfot);
            
            cell.Reasons.font=[UIFont systemFontOfSize:contenfot];
            cell.Reasons.textAlignment=NSTextAlignmentCenter;
            if ([[serviceStatus objectAtIndex:indexPath.row] isEqualToString:@"A"]) {
                cell.Reasons.textColor=hongsecolor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"服务申请"];
            }if ([[serviceStatus objectAtIndex:indexPath.row] isEqualToString:@"R"]) {
                cell.Reasons.textColor=luseColor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"服务登记"];
            }
            if ([[serviceStatus objectAtIndex:indexPath.row] isEqualToString:@"C"]) {
                cell.Reasons.textColor=luseColor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"服务确认"];
            }
            
            
            cell.anzhuang.frame=CGRectMake(cell.Reasons.right-1,  20, 55, contenfot);
            
            cell.anzhuang.font=[UIFont systemFontOfSize:contenfot];
            cell.anzhuang.textAlignment=NSTextAlignmentCenter;
            
            if ([[payStatus objectAtIndex:indexPath.row] isEqualToString:@"N"]) {
                cell.anzhuang.textColor=titleColor;
                cell.anzhuang.text=@"";
            }
            if ([[payStatus objectAtIndex:indexPath.row] isEqualToString:@"Y"]) {
                cell.anzhuang.textColor=luseColor;
                
                cell.anzhuang.text=@"";
                
            }
            
            cell.ItemName.text=[NSString stringWithFormat:@"%@", @"服务"];
            cell.ItemName.font=[UIFont systemFontOfSize:contenfot];
            cell.ItemName.textColor=zhonghuiColor;
            cell.ItemName.frame=CGRectMake(15,  70,  labelsize12.width+3, contenfot);
            NSString *s12 = [NSString stringWithFormat:@"%@ %@ %@件",cell.DocStatus.text, [itemTypes objectAtIndex:indexPath.row], [Number objectAtIndex:indexPath.row]];
            UIFont *font12 = [UIFont systemFontOfSize:contenfot];
            CGSize size12 = CGSizeMake(320, 2000);
            CGSize labelsize12 = [s12 sizeWithFont:font12 constrainedToSize:size12 lineBreakMode:NSLineBreakByCharWrapping];

            cell.ItemName1.text=[NSString stringWithFormat:@"%@ %@ %@件",cell.DocStatus.text, [itemTypes objectAtIndex:indexPath.row], [Number objectAtIndex:indexPath.row]];
            cell.ItemName1.font=[UIFont systemFontOfSize:contenfot];
            cell.ItemName1.textColor=shenhuicolor;
            cell.ItemName1.frame=CGRectMake(cell.ItemName.right, 70, labelsize12.width+5, contenfot);
        }
        
        
        //refund
        
        if ([[orderType objectAtIndex:indexPath.row] isEqualToString:@"refund"]) {
            cell.DocStatus.frame=CGRectMake(cell.DocNum.right-6,  20, 60, contenfot);
            cell.DocStatus.font=[UIFont systemFontOfSize:contenfot];
            cell.DocStatus.textAlignment=NSTextAlignmentCenter;
            cell.DocStatus.textColor=hongsecolor;
            cell.DocStatus.text=[NSString stringWithFormat:@"%@",  [reasonType objectAtIndex:indexPath.row]];
            
            
            
            cell.Reasons.frame=CGRectMake(cell.DocStatus.right-1,  20, 55, contenfot);
            
            cell.Reasons.font=[UIFont systemFontOfSize:contenfot];
            cell.Reasons.textAlignment=NSTextAlignmentCenter;
            if ([[refundType objectAtIndex:indexPath.row] isEqualToString:@"A"]) {
                cell.Reasons.textColor=hongsecolor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"退货申请"];
            }if ([[refundType objectAtIndex:indexPath.row] isEqualToString:@"R"]) {
                cell.Reasons.textColor=luseColor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"退货登记"];
            }
            if ([[refundType objectAtIndex:indexPath.row] isEqualToString:@"C"]) {
                cell.Reasons.textColor=luseColor;
                cell.Reasons.text=[NSString stringWithFormat:@"%@",  @"退货确认"];
            }
            
            
            cell.anzhuang.frame=CGRectMake(cell.Reasons.right-1,20, 55, contenfot);
            
            cell.anzhuang.font=[UIFont systemFontOfSize:contenfot];
            cell.anzhuang.textAlignment=NSTextAlignmentCenter;
            
            if ([[refundStatus objectAtIndex:indexPath.row] isEqualToString:@"N"]) {
                cell.anzhuang.textColor=titleColor;
                cell.anzhuang.text=@"";
            }
            if ([[refundStatus objectAtIndex:indexPath.row] isEqualToString:@"Y"]) {
                cell.anzhuang.textColor=luseColor;
                
                cell.anzhuang.text=@"";
                
            }
            
            
            cell.ItemName.text=[NSString stringWithFormat:@"%@", @"退货"];
            cell.ItemName.font=[UIFont systemFontOfSize:contenfot];
            cell.ItemName.textColor=zhonghuiColor;
            cell.ItemName.frame=CGRectMake(15,   70,  labelsize12.width+3, contenfot);
            NSString *s12 = [NSString stringWithFormat:@"%@ %@件", [ItemName objectAtIndex:indexPath.row], [Number objectAtIndex:indexPath.row]];
            UIFont *font12 = [UIFont systemFontOfSize:contenfot];
            CGSize size12 = CGSizeMake(320, 2000);
            CGSize labelsize12 = [s12 sizeWithFont:font12 constrainedToSize:size12 lineBreakMode:NSLineBreakByCharWrapping];

            cell.ItemName1.text=[NSString stringWithFormat:@"%@ %@件", [ItemName objectAtIndex:indexPath.row], [Number objectAtIndex:indexPath.row]];
            cell.ItemName1.font=[UIFont systemFontOfSize:contenfot];
            cell.ItemName1.textColor=shenhuicolor;
            cell.ItemName1.frame=CGRectMake(cell.ItemName.right,70, labelsize12.width+5, contenfot);
       
        
        }
        
        
        
        cell.GuideCode.text=[NSString stringWithFormat:@"%@", @"员工"];
        cell.GuideCode.font=[UIFont systemFontOfSize:contenfot];
        cell.GuideCode.textColor=zhonghuiColor;
        cell.GuideCode.frame=CGRectMake(15,  50,  30, contenfot);
        
        NSString *s1 = [NSString stringWithFormat:@"￥%@", [dic objectForKey:@"createName"]];
        UIFont *font1 = [UIFont systemFontOfSize:contenfot];
        CGSize size1 = CGSizeMake(ScreenWidth-30, 2000);
        CGSize labelsize1 = [s1 sizeWithFont:font1 constrainedToSize:size1 lineBreakMode:NSLineBreakByCharWrapping];
        cell.GuideCode1.text=[NSString stringWithFormat:@"%@", [dic objectForKey:@"createName"]];
        cell.GuideCode1.font=[UIFont systemFontOfSize:contenfot];
        cell.GuideCode1.textColor=shenhuicolor;
        cell.GuideCode1.frame=CGRectMake(cell.GuideCode.right,   50,  labelsize1.width, contenfot);
        
        cell.MemberCode.text=[NSString stringWithFormat:@"%@", @"日期"];
        cell.MemberCode.font=[UIFont systemFontOfSize:contenfot];
        cell.MemberCode.textColor=zhonghuiColor;
        cell.MemberCode.frame=CGRectMake(cell.GuideCode1.right,  50,  30, contenfot);
        
        
        
        
        NSRange range={0,10};
        NSString* string =[[DocDate objectAtIndex:indexPath.row] substringWithRange:range];
        
        cell.MemberCode1.text=[NSString stringWithFormat:@"%@", string];
        
        cell.MemberCode1.font=[UIFont systemFontOfSize:contenfot];
        cell.MemberCode1.textColor=shenhuicolor;
        cell.MemberCode1.frame=CGRectMake(cell.MemberCode.right,  50,  200*ScreenWidth/750, contenfot);
        
        
        
        cell.DocTotal.text=[NSString stringWithFormat:@"%@", @"金额"];
        cell.DocTotal.font=[UIFont systemFontOfSize:contenfot];
        cell.DocTotal.textColor=zhonghuiColor;
        cell.DocTotal.frame=CGRectMake(cell.ItemName1.right,   70,  labelsize12.width+3, contenfot);
        
        
        NSString*GoldPrice=[NSString stringWithFormat:@"%@",[DocTotal objectAtIndex:indexPath.row]];
        NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
        [numberFormatter setPositiveFormat:@"###,##0.00;"];
        NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];
        
        NSString *s = [NSString stringWithFormat:@"￥%@", formattedNumberString];
        UIFont *font = [UIFont systemFontOfSize:contenfot];
        CGSize size = CGSizeMake(320, 2000);
        CGSize labelsize = [s sizeWithFont:font constrainedToSize:size lineBreakMode:NSLineBreakByCharWrapping];
        
        cell.DocTotal1.text=[NSString stringWithFormat:@"￥%@", formattedNumberString];
        cell.DocTotal1.font=[UIFont systemFontOfSize:contenfot];
        cell.DocTotal1.textColor=[UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1];
        cell.DocTotal1.frame=CGRectMake(cell.DocTotal.right, 70, labelsize.width+3, contenfot);
        
        if ([[NSString stringWithFormat:@"%@",[earnestMoney objectAtIndex:indexPath.row]] isEqualToString:@"0"]) {
            
        }else{

        }
        
        
        
        if (DocNum.count !=indexPath.row+1) {
            UILabel *lineLabel21=[[UILabel alloc] initWithFrame:CGRectMake(15, 105-0.35, ScreenWidth-30, 0.35)];
            lineLabel21.backgroundColor=[UIColor groupTableViewBackgroundColor];;
            [cell.contentView addSubview:lineLabel21];
            
        }
        
        if (DocNum.count ==indexPath.row+1) {
            UILabel *lineLabel21=[[UILabel alloc] initWithFrame:CGRectMake(0,105-0.35, ScreenWidth, 0.35)];
            lineLabel21.backgroundColor=[UIColor groupTableViewBackgroundColor];
            [cell.contentView addSubview:lineLabel21];
            
        }
    }
    


 /////////////////
    if (tableView == table_list1) {
        
        if ([[NSString stringWithFormat:@"%@", [isUsed objectAtIndex:indexPath.row]]isEqualToString:@"1"]) {
            cell = [[orderListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            cell.DocNum= [[UILabel alloc]initWithFrame:CGRectMake(15, 20, 200,18)];
            cell.DocNum.text =[NSString stringWithFormat:@"¥ %@ ", [price objectAtIndex:indexPath.row]];
            
            cell.DocNum.textColor=zhonghuiColor;
            cell.DocNum.font= [UIFont fontWithName:@"Arial" size:18];
            [cell.contentView addSubview: cell.DocNum];
            
            
            NSString*GoldPrice=[NSString stringWithFormat:@"%@",[useLimitAmt objectAtIndex:indexPath.row]];
            NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
            [numberFormatter setPositiveFormat:@"###,##0;"];
            NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];

            UILabel *useLimitAmt1=[[UILabel alloc]initWithFrame:CGRectMake(15,  55, 150, 14)];
            
            useLimitAmt1.text=[NSString stringWithFormat:@"满 ¥ %@ 使用",formattedNumberString];
            
            useLimitAmt1.textColor=zhonghuiColor;
            useLimitAmt1.font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:useLimitAmt1];
            
            UILabel *Date =[[UILabel alloc]initWithFrame:CGRectMake(15,  75, 320, 14)];
            
            
            
            
            NSRange range={0,10};
            NSString* string =[[beginDate objectAtIndex:indexPath.row] substringWithRange:range];
            NSRange range1={0,10};
            NSString* string1 =[[endDate objectAtIndex:indexPath.row] substringWithRange:range1];
            Date .text=[NSString stringWithFormat:@"有效期 %@ ~ %@",string,string1];

            
            Date .textColor=zhonghuiColor;
            Date .font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:Date ];
            
            
            
            UILabel *isUsed1 =[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-180,  20, 160, 14)];
            
            isUsed1 .text=[NSString stringWithFormat:@"%@",@"已使用"];
            isUsed1.textAlignment=NSTextAlignmentRight;
            isUsed1 .textColor=zhonghuiColor;
            isUsed1 .font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:isUsed1 ];
            
//            NSRange range2={0,10};
//            NSString* string2 =[[useTime objectAtIndex:indexPath.row] substringWithRange:range2];
           
            
            UILabel *time =[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-180,  75, 160, 14)];
            time .text=[NSString stringWithFormat:@"%@",[useTime objectAtIndex:indexPath.row]];
            time.textAlignment=NSTextAlignmentRight;
            time .textColor=shenhuicolor;
            time .font=[UIFont systemFontOfSize:14];
            [cell.contentView addSubview:time ];

        }else{
            cell = [[orderListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
           cell.DocNum= [[UILabel alloc]initWithFrame:CGRectMake(15, 20, 200,18)];
            cell.DocNum.text =[NSString stringWithFormat:@"¥ %@ ", [price objectAtIndex:indexPath.row]];
            
            cell.DocNum.textColor=[UIColor blackColor];
          
            cell.DocNum.font= [UIFont fontWithName:@"Arial" size:18];
            [cell.contentView addSubview: cell.DocNum];
            UILabel *useLimitAmt1=[[UILabel alloc]initWithFrame:CGRectMake(15,  55, 150, 14)];
            
            useLimitAmt1.text=[NSString stringWithFormat:@"满 ¥ %@ 使用",[useLimitAmt objectAtIndex:indexPath.row]];
            
            useLimitAmt1.textColor=shenhuicolor;
            useLimitAmt1.font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:useLimitAmt1];
            
            UILabel *Date =[[UILabel alloc]initWithFrame:CGRectMake(15,  75, 320, 14)];
            
            
            
            NSRange range={0,10};
            NSString* string =[[beginDate objectAtIndex:indexPath.row] substringWithRange:range];
            NSRange range1={0,10};
            NSString* string1 =[[endDate objectAtIndex:indexPath.row] substringWithRange:range1];
            Date .text=[NSString stringWithFormat:@"有效期 %@ ~ %@",string,string1];
            
            Date .textColor=shenhuicolor;
            Date .font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:Date ];
            
            
            
            UILabel *isUsed1 =[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-180,  20, 160, 14)];
            
            isUsed1 .text=[NSString stringWithFormat:@"%@",@"未使用"];
            isUsed1.textAlignment=NSTextAlignmentRight;
            isUsed1 .textColor=luseColor;
            isUsed1 .font=[UIFont systemFontOfSize:14];
            [cell.contentView addSubview:isUsed1 ];
            
            


            
}
        
        

        
        if (price.count !=indexPath.row+1) {
            UILabel *lineLabel21=[[UILabel alloc] initWithFrame:CGRectMake(15, 105-0.35, ScreenWidth-30, 0.35)];
            lineLabel21.backgroundColor=[UIColor groupTableViewBackgroundColor];;
            [cell.contentView addSubview:lineLabel21];
            
        }
        
        if (price.count ==indexPath.row+1) {
            UILabel *lineLabel21=[[UILabel alloc] initWithFrame:CGRectMake(0, 105-0.35, ScreenWidth, 0.35)];
            lineLabel21.backgroundColor=[UIColor groupTableViewBackgroundColor];
            [cell.contentView addSubview:lineLabel21];
            
        }

        
        
    }
    
    
    
 /////////////////
    if (tableView == table_list2) {
        
        if ([[NSString stringWithFormat:@"%@", [isUsedName objectAtIndex:indexPath.row]]isEqualToString:@"未参加"]) {
            cell = [[orderListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            cell.DocNum= [[UILabel alloc]initWithFrame:CGRectMake(15, 20, 200,18)];
            cell.DocNum.text =[NSString stringWithFormat:@"%@", [actName objectAtIndex:indexPath.row]];
            
            cell.DocNum.textColor=[UIColor blackColor];
            cell.DocNum.font= [UIFont fontWithName:@"Arial" size:18];
            [cell.contentView addSubview: cell.DocNum];
            UILabel *useLimitAmt1=[[UILabel alloc]initWithFrame:CGRectMake(15,  55, 150, 14)];
            
            useLimitAmt1.text=[NSString stringWithFormat:@"活动类型 %@",[actType objectAtIndex:indexPath.row]];
            
            useLimitAmt1.textColor=zhonghuiColor;
            useLimitAmt1.font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:useLimitAmt1];
            
            UILabel *Date =[[UILabel alloc]initWithFrame:CGRectMake(15,  75, 320, 14)];
            NSRange range={0,10};
            NSString* string =[[ActbeginDate objectAtIndex:indexPath.row] substringWithRange:range];
            NSRange range1={0,10};
            NSString* string1 =[[ActendDate objectAtIndex:indexPath.row] substringWithRange:range1];
            Date .text=[NSString stringWithFormat:@"活动时间 %@ ~ %@",string,string1];
            
            Date .textColor=zhonghuiColor;
            Date .font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:Date ];
     
            
        }else{
        

           
        
        }
        NSRange range1={0,10};
        NSString* string1 =[[actuseTime objectAtIndex:indexPath.row] substringWithRange:range1];
        UILabel *time =[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-180,  75, 160, 14)];
        
        time .text=[NSString stringWithFormat:@"%@",string1];
        time.textAlignment=NSTextAlignmentRight;
        time .textColor=shenhuicolor;
        time .font=[UIFont systemFontOfSize:14];
        [cell.contentView addSubview:time ];
        
        
        
          if ([[NSString stringWithFormat:@"%@", [actStatus objectAtIndex:indexPath.row]]isEqualToString:@"0"]) {
        
        
        UILabel *isUsed1 =[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-180,  20, 160, 14)];
        
        isUsed1 .text=[NSString stringWithFormat:@"%@",@"未开始"];
        isUsed1.textAlignment=NSTextAlignmentRight;
        isUsed1 .textColor=hongsecolor;
        isUsed1 .font=[UIFont systemFontOfSize:14];
        
        [cell.contentView addSubview:isUsed1 ];
 
          }
        if ([[NSString stringWithFormat:@"%@", [actStatus objectAtIndex:indexPath.row]]isEqualToString:@"1"]) {
            
            
            UILabel *isUsed1 =[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-180,  20, 160, 14)];
            
            isUsed1 .text=[NSString stringWithFormat:@"%@",@"进行中"];
            isUsed1.textAlignment=NSTextAlignmentRight;
            isUsed1 .textColor=luseColor;
            isUsed1 .font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:isUsed1 ];
            
        }

        if ([[NSString stringWithFormat:@"%@", [actStatus objectAtIndex:indexPath.row]]isEqualToString:@"2"]) {
            
            
            UILabel *isUsed1 =[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-180,  20, 160, 14)];
            
            isUsed1 .text=[NSString stringWithFormat:@"%@",@"已结束"];
            isUsed1.textAlignment=NSTextAlignmentRight;
            isUsed1 .textColor=zhonghuiColor;
            isUsed1 .font=[UIFont systemFontOfSize:14];
            
            [cell.contentView addSubview:isUsed1 ];
            
        }

        
        
        
        if (price.count !=indexPath.row+1) {
            UILabel *lineLabel21=[[UILabel alloc] initWithFrame:CGRectMake(15,105-0.35, ScreenWidth-30, 0.35)];
            lineLabel21.backgroundColor=[UIColor groupTableViewBackgroundColor];;
            [cell.contentView addSubview:lineLabel21];
            
        }
        
        if (price.count ==indexPath.row+1) {
            UILabel *lineLabel21=[[UILabel alloc] initWithFrame:CGRectMake(0,105-0.35, ScreenWidth, 0.35)];
            lineLabel21.backgroundColor=[UIColor groupTableViewBackgroundColor];
            [cell.contentView addSubview:lineLabel21];
            
        }
        
        
        
    }
    
    return cell;
}

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 105;
}
#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
  
if (tableView == table_list) {
    if ([[orderType objectAtIndex:indexPath.row] isEqualToString:@"order"]) {
        
        commdity.orderId=orderId[indexPath.row];
        
        commdity.orderStatus=orderStatus[indexPath.row];
        commdity.deliveryStatus=deliveryStatus[indexPath.row];
        commdity.installStatus=installStatus[indexPath.row];
        OrderDetailViewController *detailViewController = [[OrderDetailViewController alloc] init];
        [self.navigationController pushViewController:detailViewController animated:YES];
        
    }
    
    if ([[orderType objectAtIndex:indexPath.row] isEqualToString:@"service"]) {
        commdity.orderId=orderId[indexPath.row];
        ServiceDetailViewController *detailViewController = [[ServiceDetailViewController alloc] init];
        [self.navigationController pushViewController:detailViewController animated:YES];
        
        
        
    }
    if ([[orderType objectAtIndex:indexPath.row] isEqualToString:@"refund"]) {
        commdity.orderId=orderId[indexPath.row];
        RefundDetailViewController *detailViewController = [[RefundDetailViewController alloc] init];
        [self.navigationController pushViewController:detailViewController animated:YES];
        
    }
        }
if (tableView == table_list1) {
    
//    commdity.actTypeCode=couponId[indexPath.row];
//    
//    BusinessCouponDetailViewController*vc1=[[BusinessCouponDetailViewController alloc] init];
//    
//    [self.navigationController pushViewController:vc1 animated:YES];
//   
    
        }
    if (tableView == table_list2) {
//        commdity.orderId=actId[indexPath.row];
//        
//        BusinessActDetailViewController*vc1=[[BusinessActDetailViewController alloc] init];
//        
//        [self.navigationController pushViewController:vc1 animated:YES];
    
    }
}

#pragma mark - Table view delegate
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{
    
    //     bugview.frame=CGRectMake(0, ScreenHeight, ScreenWidth, 50);
    
    //    if (lastContentOffset < scrollView.contentOffset.y) {
    //
    //        [[self rdv_tabBarController] setTabBarHidden:!self.rdv_tabBarController.tabBarHidden animated:NO];
    //
    //    }else{
    //
    //        [[self rdv_tabBarController] setTabBarHidden:!self.rdv_tabBarController.tabBarHidden animated:YES];
    //
    //    }
}
-(void)jifen:(UIButton*)sender{
//    commdity.gengxin=@"123";
//    BusinessMemberfindIntegralListViewController *detailViewController = [[BusinessMemberfindIntegralListViewController alloc] init];
//    [self.navigationController pushViewController:detailViewController animated:YES];
    
    
    
}



-(void)duodiz:(UIButton*)sender{
    
    
    
    
    
    commdity.addhuiyuanViewController=@"";

    BusinessMemberAddressViewController *detailViewController = [[BusinessMemberAddressViewController alloc] init];
    [self.navigationController pushViewController:detailViewController animated:YES];
    
    
    
}


-(void)editor:(UIButton*)sender{
    
//    EditHuiyuanViewController *detailViewController = [[EditHuiyuanViewController alloc] init];
//    [self.navigationController pushViewController:detailViewController animated:YES];
    
    
    commdity.gengxin=@"123";
    MemberInformationViewController *detailViewController = [[MemberInformationViewController alloc] init];
    [self.navigationController pushViewController:detailViewController animated:YES];
    
    
    
}

- (void)showAlertWait
{
    alt = [[UIAlertView alloc] initWithTitle:@"网络不稳定 ！" message:@"请确认网络" delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
    
}

- (void)showAlertMessage:(NSString *)msg
{
    alt = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
}
- (void)hideAlert
{
    if (alt != nil)
    {
        [alt dismissWithClickedButtonIndex:0 animated:YES];
        alt = nil;
    }
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
